<template>
  <div class="con">
    <h3>{{info.title}}</h3>
    <p class="mui-ellipsis"><span>更新时间：{{info.pubdate|formatDate}}</span><span>{{info.writer}}</span></p>
    <hr>
    <div class="new-contaniner" v-html="body"></div>		
    <comments :id="this.id" :arctit="this.info.title"></comments>  
  </div>
</template>

<script>
   
import comments from './comments.vue'
export default {
  data() {
    return {
      id:this.$route.params.id,
      info:{},
      body:'',

    };
  },
  mounted: function(){
            
        },
  methods: { 
     newinfo(){
      this.$http.get('http://192.168.0.104/linshi/api/get_arc.php?id='+this.id).then((res) => {
        
       if(res.status ==200){
         this.info=res.body;
         this.body= res.body.body.replace(/size="3"/g, "style='font-size:12px'")
           console.log('123')
       }
          console.log(this.info)
       
        
      });
     }
            
        },
  components: {
        comments
    },
  created() {
   this.newinfo();
   this.$store.state.isBack=true;
	this.$store.state.appTit='新闻详情'+this.info.title;
  },
  watch: {
    "info":function(){
       this.$emit("changTit",true,'新闻详情-'+this.info.title);
    }
  },
};
</script>

<style lang="scss">
.con{padding: 10px;
box-sizing: border-box;overflow: hidden;
  h3{font-size: 16px;line-height: 1.25em}
 .new-contaniner{overflow-x: hidden;font-size:12px;color:#8f8f94;
   p,font{font-size: 12px;}
 }
  
  

}
   
</style>
